package com.dfrz.bookstore.service.impl;

import com.dfrz.bookstore.dao.Dao;
import com.dfrz.bookstore.dao.impl.AdminDaoImpl;
import com.dfrz.bookstore.entry.Admin;
import com.dfrz.bookstore.entry.Book;
import com.dfrz.bookstore.service.AdminService;
import com.dfrz.bookstore.util.SendEmaiUtil;
import com.dfrz.bookstore.view.AdminJFrame;

import javax.mail.MessagingException;
import javax.swing.*;
import java.util.Random;

/**
 * 类功能描述:
 *
 * @Author keyan
 * @Date 2021/5/19 0:19
 */
public class AdminServiceImpl implements AdminService {
    private AdminDaoImpl adminDao = new AdminDaoImpl();

    @Override
    public Admin loginBypassWord(Admin admin) {
        Admin adminLogin = adminDao.login(admin);
        if(adminLogin!=null){
            return adminLogin;
        }else {
            JOptionPane.showMessageDialog(null,"管理员登入失败");
            return null;
        }
    }




    @Override
    public void UpdateAdmin(Admin admin) {
        adminDao.updateByObj(admin);
    }


}
